Skip to main content

๐Ÿ›  Creating a Custom Bot

Prime Automation gives you full flexibility to build your own custom trading bot using TradingView alerts. Whether you're using ChartPrime indicators or your own Pine Script strategy, this feature enables real-time, webhook-triggered trading โ€” directly from your TradingView charts.

With full support for Bitget, BloFin, and TradeStation, your custom bot can operate on spot or futures markets using structured alerts.


๐Ÿ“ Step 1: Navigate to the Custom Bot Setupโ€‹

From the top navigation bar:

๐Ÿ–ฑ๏ธ Click Custom Bot

This opens the 3-step bot creation wizard.


โš™๏ธ Step 2: Fill Out General Settingsโ€‹

On the first screen, you'll define how your custom bot behaves.

General Settings Fieldsโ€‹

FieldDescription
ExchangeChoose your connected exchange (e.g. Bitget, BloFin, TradeStation)
Trading TypeChoose Spot or Futures
Pair(s)Select the crypto pair (e.g. BTC/USDT) your bot will trade
Allow Layered EntriesEnable to allow the bot to scale in with multiple entries
Amount per TradeChoose either: Fixed Dollar Amount (e.g. $20) or % of Account Balance (e.g. 5%)
Use TradingView AmountIf enabled, the bot will respect the size passed in your TradingView alert
Bot NameName your bot (e.g. "Breakout Sniper")
Bot StatusSet the bot to Active or Inactive
Margin ModeSelect Cross or Isolated when futures is selected
Limit Kill Period(Optional) Auto-cancel inactive limit orders after this duration (e.g. 10 mins)

โœ… Once filled, click the orange Next button to continue to the TradingView webhook instructions.


๐Ÿ”— Step 3: Connect to TradingViewโ€‹

After saving your bot configuration, youโ€™ll see the message:

"Bot created! Now connect your bot to TradingView"

This screen gives you a unique webhook URL and important instructions.

โš ๏ธ Match Your Chart to Your Exchangeโ€‹

Ensure your TradingView chart matches the exchange you selected during bot setup.

For example:

  • If you selected Bitget, trigger alerts from a Bitget chart.
  • If you use a Binance chart for a Bitget bot, the alert will misfire or fail.

๐ŸŒ Step 4: Copy Webhook & Alert Messagesโ€‹

1. Webhook URLโ€‹

This is your unique endpoint. Copy and paste it into the "Webhook URL" field when creating your TradingView alert.

https://api.primeautomation.ai/webhook/ChartPrime/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

๐Ÿ“‹ Click the copy icon in the interface to quickly grab the link.


2. Basic Alert Message (for non-ChartPrime users)โ€‹

If you're using any TradingView strategy other than PA Strategy Builder, use:

{{strategy.order.alert_message}}

Paste this into the "Message" field of your TradingView alert. It will send signal details (buy/sell/exit) automatically.


3. Full Indicator Message Templates (Advanced)โ€‹

Use these JSON message formats to send custom webhook signals with full control.

โœ… BUYโ€‹

{
"ticker": "{{ticker}}",
"action": "buy",
"price": "{{close}}",
"time": "{{timenow}}",
"size": "{{size}}"
}

๐ŸŸก EXIT_BUYโ€‹

{
"ticker": "{{ticker}}",
"action": "exit_buy",
"price": "{{close}}",
"time": "{{timenow}}",
"size": "{{size}}",
"per": "{{per}}",
"sl": "{{sl}}",
"tp": "{{tp}}"
}

๐Ÿ”ป SELLโ€‹

{
"ticker": "{{ticker}}",
"action": "sell",
"price": "{{close}}",
"time": "{{timenow}}",
"size": "{{size}}"
}

๐Ÿ”ด EXIT_SELLโ€‹

{
"ticker": "{{ticker}}",
"action": "exit_sell",
"price": "{{close}}",
"time": "{{timenow}}",
"size": "{{size}}",
"per": "{{per}}",
"sl": "{{sl}}",
"tp": "{{tp}}"
}

๐Ÿ“Œ These are for advanced Pine Script users or when building your own signal logic. You can dynamically insert variables using TradingView alert syntax.


โœ… Final Step: Deploy & Monitorโ€‹

Click Continue to Dashboard.

Your bot is now live and ready to receive webhook alerts. Youโ€™ll see it appear on your dashboard where you can:

  • ๐ŸŸข Toggle it ON/OFF
  • โœ๏ธ Edit configuration
  • ๐Ÿ“Š Track live trades and PNL
  • ๐Ÿงพ View trade history

๐Ÿง  Best Practicesโ€‹

  • ๐Ÿ” Keep your webhook URL private. It acts as the key to your bot.